
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Redis中的队列list实现秒杀活动抢购 · JAVA学习积累</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="tianwyam">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../SQL/sql_mysql_green_install.html" />
    
    
    <link rel="prev" href="redis_study_notes.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://blog.csdn.net/mybook201314" target="_blank" class="custom-link">博客Blog</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">【前言】</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    介绍ABOUT
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第一章】Java基础</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../java/java.html">
            
                <a href="../java/java.html">
            
                    
                    计算机基础-操作系统-进程-计算机网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../java/java_thread_pool.html">
            
                <a href="../java/java_thread_pool.html">
            
                    
                    线程池的工作原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="../java/java_ftp.html">
            
                <a href="../java/java_ftp.html">
            
                    
                    FTP文件服务器上传下载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../java/collection.html">
            
                <a href="../java/collection.html">
            
                    
                    集合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../java/collection/java_collection_map.html">
            
                <a href="../java/collection/java_collection_map.html">
            
                    
                    Map&HashMap&HashTable&ConcurrentHashMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="../java/java_queue.html">
            
                <a href="../java/java_queue.html">
            
                    
                    队列-queue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.3" data-path="../java/java_tree.html">
            
                <a href="../java/java_tree.html">
            
                    
                    二叉树遍历
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../java/java_io_nio.html">
            
                <a href="../java/java_io_nio.html">
            
                    
                    java输入输出流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../java/java_exception.html">
            
                <a href="../java/java_exception.html">
            
                    
                    异常exception
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../java/java_serialize.html">
            
                <a href="../java/java_serialize.html">
            
                    
                    Java序列化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="../java/Java_annotation.html">
            
                <a href="../java/Java_annotation.html">
            
                    
                    注解
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../java/multi.html">
            
                <a href="../java/multi.html">
            
                    
                    多线程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../java/multithread/java_multi_thread_volatile_synchronized.html">
            
                <a href="../java/multithread/java_multi_thread_volatile_synchronized.html">
            
                    
                    volatile&synchronized
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../java/multithread/java_multi_thread_object_wait_notify.html">
            
                <a href="../java/multithread/java_multi_thread_object_wait_notify.html">
            
                    
                    object/wait/notify
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3" data-path="../java/multithread/java_multi_thread_thread.html">
            
                <a href="../java/multithread/java_multi_thread_thread.html">
            
                    
                    thread
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4" data-path="../java/multithread/java_multi_thread_threadpool.html">
            
                <a href="../java/multithread/java_multi_thread_threadpool.html">
            
                    
                    线程池的工作原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5" data-path="../java/multithread/java_multi_thread_lock.html">
            
                <a href="../java/multithread/java_multi_thread_lock.html">
            
                    
                    lock&ReentrantLock&ReadWriteLock
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.6" data-path="../java/multithread/java_multi_thread_lock_condition.html">
            
                <a href="../java/multithread/java_multi_thread_lock_condition.html">
            
                    
                    lock&condition
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.7" data-path="../java/multithread/java_multi_thread_tools.html">
            
                <a href="../java/multithread/java_multi_thread_tools.html">
            
                    
                    Java并发工具- CountDownLatch&CyclicBarrier 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.8" data-path="../java/multithread/java_multi_thread_tools2.html">
            
                <a href="../java/multithread/java_multi_thread_tools2.html">
            
                    
                    Java同步工具类- CountDownLatch&CyclicBarrier&Semaphore  
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../java/java_jvm.html">
            
                <a href="../java/java_jvm.html">
            
                    
                    java虚拟机-JVM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../java/java_java7new.html">
            
                <a href="../java/java_java7new.html">
            
                    
                    java7新知识- Switch&TWR&Objects 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="../java/java_stream.html">
            
                <a href="../java/java_stream.html">
            
                    
                    Java8对集合流操作stream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="../java/java_stream_groupby.html">
            
                <a href="../java/java_stream_groupby.html">
            
                    
                    java8新语法-Stream-分组groupingBy操作 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="../java/java_optional.html">
            
                <a href="../java/java_optional.html">
            
                    
                    java8新语法-Optional 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="../java/java_8new_date_api.html">
            
                <a href="../java/java_8new_date_api.html">
            
                    
                    java8-新的日期时间API 
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../xml/xml_translation.html">
            
                <a href="../xml/xml_translation.html">
            
                    
                    XML中特殊符号的转译 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../datastructure/binary_complement.html">
            
                <a href="../datastructure/binary_complement.html">
            
                    
                    原码、反码、补码 
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="../java/basic/javabean2map.html">
            
                <a href="../java/basic/javabean2map.html">
            
                    
                    Java bean转Map 
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第二章】算法积累题</li>
        
        
    
        <li class="chapter " data-level="8.1" data-path="../algorithm/merge_sorted_array.html">
            
                <a href="../algorithm/merge_sorted_array.html">
            
                    
                    算法题 - 合并排序数组 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="../algorithm/lowest_score.html">
            
                <a href="../algorithm/lowest_score.html">
            
                    
                    算法题 - 最低分数线问题 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="../algorithm/array_sub_list.html">
            
                <a href="../algorithm/array_sub_list.html">
            
                    
                    算法题 - 求数组的子集合 
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第三章】框架</li>
        
        
    
        <li class="chapter " data-level="9.1" data-path="../Spring/springboot.html">
            
                <a href="../Spring/springboot.html">
            
                    
                    SpringBoot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="../Spring/spring_security.html">
            
                <a href="../Spring/spring_security.html">
            
                    
                    SpringSecurity
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="../linux/linux_commands_springboot_startup.html">
            
                <a href="../linux/linux_commands_springboot_startup.html">
            
                    
                    SpringBoot项目启动脚本
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="10.1" data-path="../Spring/spring/spring_interview_questions_68.html">
            
                <a href="../Spring/spring/spring_interview_questions_68.html">
            
                    
                    Spring面试题68
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="11.1" data-path="../Spring/springboot_auto_config.html">
            
                <a href="../Spring/springboot_auto_config.html">
            
                    
                    SpringBoot自动装载机制 - 源码分析
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="12.1" data-path="../Spring/spring_feign.html">
            
                <a href="../Spring/spring_feign.html">
            
                    
                    Feign在spring、springboot下使用
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="13.1" data-path="../Spring/spring_freemarker.html">
            
                <a href="../Spring/spring_freemarker.html">
            
                    
                    Spring boot集成freemarker，生成word文件
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="14.1" data-path="../Spring/spring_freemarker_generate.html">
            
                <a href="../Spring/spring_freemarker_generate.html">
            
                    
                    Freemarker自动生成Java bean代码
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="15.1" data-path="../mybatis/mybatis_metadata.html">
            
                <a href="../mybatis/mybatis_metadata.html">
            
                    
                    mybatis中操作元数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="15.2" data-path="../mybatis/mybatis_batch_exec_sql.html">
            
                <a href="../mybatis/mybatis_batch_exec_sql.html">
            
                    
                    mybatis中insert/update/delete标签中执行多条SQL语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="15.3" data-path="../mybatis/mybatis_plus.html">
            
                <a href="../mybatis/mybatis_plus.html">
            
                    
                    springboot集成mybatis-plus框架
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="16.1" data-path="../distributed/sharding-jdbc.html">
            
                <a href="../distributed/sharding-jdbc.html">
            
                    
                    【分布式】sharding-jdbc实现分库分表
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第四章】数据库</li>
        
        
    
        <li class="chapter " data-level="17.1" data-path="../SQL/sql.html">
            
                <a href="../SQL/sql.html">
            
                    
                    SQL常用使用
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="18.1" data-path="redis_study_notes.html">
            
                <a href="redis_study_notes.html">
            
                    
                    redis学习笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="18.2" data-path="redis_list_second_kill.html">
            
                <a href="redis_list_second_kill.html">
            
                    
                    Redis中的队列list实现秒杀活动抢购
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="19.1" data-path="../SQL/sql_mysql_green_install.html">
            
                <a href="../SQL/sql_mysql_green_install.html">
            
                    
                    mysql绿色版安装服务教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="19.2" data-path="../SQL/sql_h2.html">
            
                <a href="../SQL/sql_h2.html">
            
                    
                    H2内嵌数据的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="19.3" data-path="../SQL/cache.html">
            
                <a href="../SQL/cache.html">
            
                    
                    缓存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="19.4" data-path="../SQL/mysql/mysql_back_rollback.html">
            
                <a href="../SQL/mysql/mysql_back_rollback.html">
            
                    
                    MySQL单表备份还原
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第五章】Web</li>
        
        
    
        <li class="chapter " data-level="20.1" data-path="../web/web_js_jquery.html">
            
                <a href="../web/web_js_jquery.html">
            
                    
                    web简单积累
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第六章】Linux</li>
        
        
    
        <li class="chapter " data-level="21.1" data-path="../linux/linux_common_commands.html">
            
                <a href="../linux/linux_common_commands.html">
            
                    
                    linux常用命令
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第七章】Windows</li>
        
        
    
        <li class="chapter " data-level="22.1" data-path="../windows/windows_common_commands.html">
            
                <a href="../windows/windows_common_commands.html">
            
                    
                    windows常用命令
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">【第八章】错误集</li>
        
        
    
        <li class="chapter " data-level="23.1" data-path="../error/maven_not_found_local_jar.html">
            
                <a href="../error/maven_not_found_local_jar.html">
            
                    
                    maven引入依赖时识别不到本地仓库的jar
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="24.1" data-path="../error/security_not_configure_antMatchers_after_anyRequest.html">
            
                <a href="../error/security_not_configure_antMatchers_after_anyRequest.html">
            
                    
                    spring security 配置发生错误 Can't configure antMatchers after anyRequest
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="25.1" data-path="../error/AOP_stream_close_error.html">
            
                <a href="../error/AOP_stream_close_error.html">
            
                    
                    AOP内获取了对请求流操作后报流已经关闭错误的问题
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="26.1" data-path="../tools/github/github_ssh.html">
            
                <a href="../tools/github/github_ssh.html">
            
                    
                    Github ssh key 解决提交后push频繁输入用户名和密码
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="27.1" data-path="../error/sharding-jdbc-error-datasources.html">
            
                <a href="../error/sharding-jdbc-error-datasources.html">
            
                    
                    sharding-jdbc-4.1.1版本启动数据源报错问题
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Redis中的队列list实现秒杀活动抢购</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#redis&#x4E2D;&#x7684;&#x961F;&#x5217;list&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x62A2;&#x8D2D;"><b></b>Redis&#x4E2D;&#x7684;&#x961F;&#x5217;list&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x62A2;&#x8D2D;</a></li><ul><li><span class="title-icon "></span><a href="#1-&#x5F15;&#x5165;redis&#x5BA2;&#x6237;&#x7AEF;maven&#x4F9D;&#x8D56;"><b></b>1. &#x5F15;&#x5165;redis&#x5BA2;&#x6237;&#x7AEF;maven&#x4F9D;&#x8D56;</a></li><li><span class="title-icon "></span><a href="#2-&#x5B9A;&#x4E49;&#x62A2;&#x8D2D;&#x5546;&#x54C1;&#x5B9E;&#x4F53;&#x7C7B;"><b></b>2. &#x5B9A;&#x4E49;&#x62A2;&#x8D2D;&#x5546;&#x54C1;&#x5B9E;&#x4F53;&#x7C7B;</a></li><li><span class="title-icon "></span><a href="#3-&#x5B9A;&#x4E49;&#x6A21;&#x62DF;&#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;&#x7C7B;"><b></b>3. &#x5B9A;&#x4E49;&#x6A21;&#x62DF;&#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;&#x7C7B;</a></li><li><span class="title-icon "></span><a href="#4-&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;"><b></b>4. &#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;</a></li><li><span class="title-icon "></span><a href="#5-&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x7ED3;&#x679C;"><b></b>5. &#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x7ED3;&#x679C;</a></li></ul></ul></div><h1 id="redis&#x4E2D;&#x7684;&#x961F;&#x5217;list&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x62A2;&#x8D2D;"><a name="redis&#x4E2D;&#x7684;&#x961F;&#x5217;list&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x62A2;&#x8D2D;" class="anchor-navigation-ex-anchor" href="#redis&#x4E2D;&#x7684;&#x961F;&#x5217;list&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x62A2;&#x8D2D;"><i class="fa fa-link" aria-hidden="true"></i></a>Redis&#x4E2D;&#x7684;&#x961F;&#x5217;list&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x62A2;&#x8D2D;</h1>
<p><br></p>
<p>[TOC]</p>
<p><br></p>
<p><br></p>
<p>redis&#x4E2D;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;list&#x4E2D; rpush  | lpop | lpush | rpop  &#x5B9E;&#x73B0;&#x961F;&#x5217;&#x7684;&#x5148;&#x8FDB;&#x5148;&#x51FA;&#x7684;&#x7279;&#x6027;</p>
<p><br></p>
<p>lpush&#xFF1A;&#x5DE6;&#x8FB9;&#x5165;&#x961F;&#x5217;&#xFF0C;&#x5B58;&#x5165;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x7684;&#x5546;&#x54C1;</p>
<p>rpop&#xFF1A;&#x53F3;&#x8FB9;&#x51FA;&#x961F;&#x5217;&#xFF0C;&#x83B7;&#x53D6;&#x62A2;&#x5230;&#x7684;&#x5546;&#x54C1;</p>
<h2 id="1-&#x5F15;&#x5165;redis&#x5BA2;&#x6237;&#x7AEF;maven&#x4F9D;&#x8D56;"><a name="1-&#x5F15;&#x5165;redis&#x5BA2;&#x6237;&#x7AEF;maven&#x4F9D;&#x8D56;" class="anchor-navigation-ex-anchor" href="#1-&#x5F15;&#x5165;redis&#x5BA2;&#x6237;&#x7AEF;maven&#x4F9D;&#x8D56;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x5F15;&#x5165;redis&#x5BA2;&#x6237;&#x7AEF;maven&#x4F9D;&#x8D56;</h2>
<pre><code class="lang-xml">
<span class="hljs-comment">&lt;!-- java redis &#x5BA2;&#x6237;&#x7AEF; --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>redis.clients<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>jedis<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>3.1.0<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span>
</code></pre>
<h2 id="2-&#x5B9A;&#x4E49;&#x62A2;&#x8D2D;&#x5546;&#x54C1;&#x5B9E;&#x4F53;&#x7C7B;"><a name="2-&#x5B9A;&#x4E49;&#x62A2;&#x8D2D;&#x5546;&#x54C1;&#x5B9E;&#x4F53;&#x7C7B;" class="anchor-navigation-ex-anchor" href="#2-&#x5B9A;&#x4E49;&#x62A2;&#x8D2D;&#x5546;&#x54C1;&#x5B9E;&#x4F53;&#x7C7B;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x5B9A;&#x4E49;&#x62A2;&#x8D2D;&#x5546;&#x54C1;&#x5B9E;&#x4F53;&#x7C7B;</h2>
<pre><code class="lang-java">
<span class="hljs-comment">/**
 * <span class="hljs-doctag">@description</span>
 *    &#x5546;&#x54C1;&#x8D27;&#x7269;
 * <span class="hljs-doctag">@author</span> TianwYam
 * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;24&#x65E5;&#x4E0B;&#x5348;6:33:17
 */</span>
<span class="hljs-meta">@Data</span>
<span class="hljs-meta">@Builder</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Goods</span> </span>{

    <span class="hljs-comment">// &#x5546;&#x54C1;&#x7F16;&#x53F7;</span>
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">int</span> goodsId ;

    <span class="hljs-comment">// &#x5546;&#x54C1;&#x540D;&#x79F0;</span>
    <span class="hljs-keyword">private</span> String goodsName ;

    <span class="hljs-comment">// &#x4EF7;&#x683C;</span>
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">double</span> price ;

}
</code></pre>
<h2 id="3-&#x5B9A;&#x4E49;&#x6A21;&#x62DF;&#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;&#x7C7B;"><a name="3-&#x5B9A;&#x4E49;&#x6A21;&#x62DF;&#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;&#x7C7B;" class="anchor-navigation-ex-anchor" href="#3-&#x5B9A;&#x4E49;&#x6A21;&#x62DF;&#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;&#x7C7B;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x5B9A;&#x4E49;&#x6A21;&#x62DF;&#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;&#x7C7B;</h2>
<pre><code class="lang-java">
<span class="hljs-comment">/**
 * <span class="hljs-doctag">@description</span>
 *    &#x7528;&#x6237;&#x62A2;&#x8D2D;&#x7EBF;&#x7A0B;
 * <span class="hljs-doctag">@author</span> TianwYam
 * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;25&#x65E5;&#x4E0B;&#x5348;1:22:09
 */</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">PersonShoppingThread</span>  <span class="hljs-keyword">implements</span> <span class="hljs-title">Runnable</span></span>{

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> String LIST_GOODS = <span class="hljs-string">&quot;LIST_GOODS&quot;</span>;

    <span class="hljs-comment">// &#x987A;&#x5E8F;</span>
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">int</span> index ;

    <span class="hljs-comment">// &#x7528;&#x6237;&#x59D3;&#x540D;</span>
    <span class="hljs-keyword">private</span> String name ;

    <span class="hljs-keyword">private</span> Jedis jedis ;

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-title">PersonShoppingThread</span><span class="hljs-params">(<span class="hljs-keyword">int</span> index, Jedis jedis)</span> </span>{
        <span class="hljs-keyword">this</span>.index = index ;
        <span class="hljs-keyword">this</span>.jedis = jedis ;
        <span class="hljs-keyword">this</span>.name = <span class="hljs-keyword">new</span> Faker(Locale.SIMPLIFIED_CHINESE).name().fullName();
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">run</span><span class="hljs-params">()</span> </span>{

        <span class="hljs-comment">// &#x6A21;&#x62DF; &#x7528;&#x6237;&#x62A2;&#x8D2D; &#x8017;&#x65F6;</span>
        <span class="hljs-keyword">try</span> {
            Thread.sleep(<span class="hljs-number">500</span>);
        } <span class="hljs-keyword">catch</span> (InterruptedException e) {
            e.printStackTrace();
        }

        <span class="hljs-comment">// &#x83B7;&#x53D6; &#x79D2;&#x6740;&#x5546;&#x54C1;&#x961F;&#x5217; &#x6570;&#x91CF;</span>
        Long len = jedis.llen(LIST_GOODS);
        <span class="hljs-keyword">if</span> (len == <span class="hljs-keyword">null</span> || len &lt;= <span class="hljs-number">0</span>) {
            System.out.println(String.format(<span class="hljs-string">&quot; %d : %s &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;&quot;</span>, index, name));
            <span class="hljs-keyword">return</span> ;
        }

        <span class="hljs-comment">// &#x961F;&#x5217;&#x4E2D;&#x53D6;&#x51FA;&#x5546;&#x54C1;</span>
        String goods = jedis.rpop(LIST_GOODS);
        <span class="hljs-keyword">if</span> (StringUtils.isNotBlank(goods)) {
            System.out.println(String.format(<span class="hljs-string">&quot; %d : %s &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;%s&quot;</span> , index, name, goods));
        } <span class="hljs-keyword">else</span> {
            System.out.println(String.format(<span class="hljs-string">&quot; %d : %s &#x6CA1;&#x6709;&#x62A2;&#x5230;&#x79D2;&#x6740;&#x5546;&#x54C1;&quot;</span>, index, name));
        }

        <span class="hljs-comment">// &#x5173;&#x95ED;&#x56DE;&#x6536;&#x8FDE;&#x63A5;</span>
        jedis.close();
    }

}
</code></pre>
<h2 id="4-&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;"><a name="4-&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;" class="anchor-navigation-ex-anchor" href="#4-&#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;</h2>
<pre><code class="lang-java">
<span class="hljs-comment">/**
 * <span class="hljs-doctag">@description</span>
 *    redis &#x4E2D;&#x7684; list &#x5B9E;&#x73B0;&#x79D2;&#x6740;&#x6D3B;&#x52A8;
 * <span class="hljs-doctag">@author</span> TianwYam
 * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;25&#x65E5;&#x4E0B;&#x5348;1:35:30
 */</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">RedisListSecondKill</span> </span>{

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> String LIST_GOODS = <span class="hljs-string">&quot;LIST_GOODS&quot;</span>;

    <span class="hljs-comment">// redis &#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;</span>
<span class="hljs-comment">//    private static final Jedis jedis = new Jedis(&quot;localhost&quot;, 6379);</span>

    <span class="hljs-comment">// redis &#x8FDE;&#x63A5;&#x6C60;</span>
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> JedisPool JEDIS_POOL = getJedisPool();

    <span class="hljs-comment">// &#x7EBF;&#x7A0B;&#x6C60;</span>
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> <span class="hljs-keyword">static</span> ExecutorService THREAD_POOL = Executors.newFixedThreadPool(<span class="hljs-number">20</span>);


    <span class="hljs-comment">/**
     * <span class="hljs-doctag">@description</span>
     *    redis&#x8FDE;&#x63A5;&#x6C60;&#x914D;&#x7F6E; 
     * <span class="hljs-doctag">@author</span> TianwYam
     * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;26&#x65E5;&#x4E0B;&#x5348;8:18:08
     * <span class="hljs-doctag">@return</span>
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> JedisPool <span class="hljs-title">getJedisPool</span><span class="hljs-params">()</span> </span>{
        JedisPoolConfig poolConfig = <span class="hljs-keyword">new</span> JedisPoolConfig();
        poolConfig.setMaxIdle(<span class="hljs-number">40</span>);
        poolConfig.setMinIdle(<span class="hljs-number">10</span>);
        poolConfig.setMaxTotal(<span class="hljs-number">50</span>);

        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> JedisPool(poolConfig);
    }

    <span class="hljs-comment">/**
     * <span class="hljs-doctag">@description</span>
     *    &#x6A21;&#x62DF;&#x751F;&#x6210;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x6570;&#x636E;
     * <span class="hljs-doctag">@author</span> TianwYam
     * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;26&#x65E5;&#x4E0B;&#x5348;8:29:27
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">pushGoods</span><span class="hljs-params">()</span> </span>{

        Jedis jedis = JEDIS_POOL.getResource();

        <span class="hljs-comment">// &#x6A21;&#x62DF;&#x751F;&#x6210;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x6570;&#x636E;</span>
        System.out.println(<span class="hljs-string">&quot;&#x5F00;&#x59CB;&#x6A21;&#x62DF;&#x751F;&#x6210;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x6570;&#x636E;......&quot;</span>);
        Faker faker = <span class="hljs-keyword">new</span> Faker(Locale.SIMPLIFIED_CHINESE);
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt;= <span class="hljs-number">10</span>; i++) {
            Goods goods = Goods.builder()
                    .goodsId(i)
                    .goodsName(faker.food().fruit())
                    .price(faker.number().randomDouble(<span class="hljs-number">2</span>, <span class="hljs-number">1</span>, <span class="hljs-number">150</span>))
                    .build();

            <span class="hljs-comment">// &#x5F80;&#x961F;&#x5217;&#x4E2D;&#x6DFB;&#x52A0; &#x79D2;&#x6740;&#x5546;&#x54C1;</span>
            jedis.lpush(LIST_GOODS, JSON.toJSONString(goods));
        }

        System.out.println(<span class="hljs-string">&quot;&#x5B8C;&#x6210;&#x6A21;&#x62DF;&#x751F;&#x6210;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x6570;&#x636E;&quot;</span>);

        jedis.close();
    }

    <span class="hljs-comment">/**
     * <span class="hljs-doctag">@description</span>
     *    &#x83B7;&#x53D6;&#x6240;&#x6709;&#x7684;&#x79D2;&#x6740;&#x5546;&#x54C1;
     * <span class="hljs-doctag">@author</span> TianwYam
     * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;26&#x65E5;&#x4E0B;&#x5348;8:28:55
     * <span class="hljs-doctag">@return</span>
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> List&lt;String&gt; <span class="hljs-title">getGoodsList</span><span class="hljs-params">()</span> </span>{
        Jedis jedis = JEDIS_POOL.getResource();
        List&lt;String&gt; lrangeGoods = jedis.lrange(LIST_GOODS, <span class="hljs-number">0</span>, -<span class="hljs-number">1</span>);
        jedis.close();
        <span class="hljs-keyword">return</span> lrangeGoods;
    }


    <span class="hljs-comment">/**
     * <span class="hljs-doctag">@description</span>
     *    &#x542F;&#x52A8;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x4E3B;&#x7C7B;
     * <span class="hljs-doctag">@author</span> TianwYam
     * <span class="hljs-doctag">@date</span> 2021&#x5E74;10&#x6708;26&#x65E5;&#x4E0B;&#x5348;8:29:42
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{

        <span class="hljs-comment">// &#x5F80;&#x961F;&#x5217;&#x4E2D;&#x6DFB;&#x52A0; &#x79D2;&#x6740;&#x5546;&#x54C1;</span>
        pushGoods();

        <span class="hljs-comment">// &#x67E5;&#x8BE2; &#x961F;&#x5217;&#x5185;&#x5546;&#x54C1;&#x6570;&#x91CF;</span>
        List&lt;String&gt; lrangeGoods = getGoodsList();
        <span class="hljs-keyword">if</span> (lrangeGoods == <span class="hljs-keyword">null</span> || lrangeGoods.size() == <span class="hljs-number">0</span>) {
            System.out.println(<span class="hljs-string">&quot;&#x6CA1;&#x6709;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x4E86; &#x6216;&#x8005; &#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x5DF2;&#x7ED3;&#x675F;&quot;</span>);
            <span class="hljs-keyword">return</span> ;
        }

        System.out.println(<span class="hljs-string">&quot;\n&#x6240;&#x6709;&#x7684;&#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;&quot;</span>);
        System.out.println(JSON.toJSONString(lrangeGoods, <span class="hljs-keyword">true</span>));

        System.out.println(<span class="hljs-string">&quot;\n&#x6240;&#x6709;&#x7684;&#x7528;&#x6237;&#x5F00;&#x59CB;&#x8FDB;&#x884C;&#x62A2;&#x8D2D;&#xFF1A;&quot;</span>);
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">30</span>; i++) {
            THREAD_POOL.submit(<span class="hljs-keyword">new</span> PersonShoppingThread(i, JEDIS_POOL.getResource()));
        }

        <span class="hljs-keyword">try</span> {
            THREAD_POOL.awaitTermination(<span class="hljs-number">10</span>, TimeUnit.SECONDS);
            THREAD_POOL.shutdown();
            JEDIS_POOL.close();
        } <span class="hljs-keyword">catch</span> (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(<span class="hljs-string">&quot;&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x7ED3;&#x675F;&quot;</span>);
    }

}
</code></pre>
<h2 id="5-&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x7ED3;&#x679C;"><a name="5-&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x7ED3;&#x679C;" class="anchor-navigation-ex-anchor" href="#5-&#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x7ED3;&#x679C;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x79D2;&#x6740;&#x62A2;&#x8D2D;&#x6D3B;&#x52A8;&#x7ED3;&#x679C;</h2>
<pre><code class="lang-verilog">&#x5F00;&#x59CB;&#x6A21;&#x62DF;&#x751F;&#x6210;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x6570;&#x636E;......
&#x5B8C;&#x6210;&#x6A21;&#x62DF;&#x751F;&#x6210;&#x79D2;&#x6740;&#x5546;&#x54C1;&#x6570;&#x636E;

&#x6240;&#x6709;&#x7684;&#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;
[
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:10,\&quot;goodsName\&quot;:\&quot;Prunes\&quot;,\&quot;price\&quot;:88.97}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:9,\&quot;goodsName\&quot;:\&quot;Mangosteens\&quot;,\&quot;price\&quot;:105.82}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:8,\&quot;goodsName\&quot;:\&quot;Cherries\&quot;,\&quot;price\&quot;:76.04}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:7,\&quot;goodsName\&quot;:\&quot;Sultanas\&quot;,\&quot;price\&quot;:59.16}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:6,\&quot;goodsName\&quot;:\&quot;Cavalo\&quot;,\&quot;price\&quot;:20.93}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:5,\&quot;goodsName\&quot;:\&quot;Corella Pear\&quot;,\&quot;price\&quot;:12.8}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:4,\&quot;goodsName\&quot;:\&quot;Kiwi Fruit\&quot;,\&quot;price\&quot;:125.18}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:3,\&quot;goodsName\&quot;:\&quot;Nectarines\&quot;,\&quot;price\&quot;:19.5}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:2,\&quot;goodsName\&quot;:\&quot;Mulberries\&quot;,\&quot;price\&quot;:71.42}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:1,\&quot;goodsName\&quot;:\&quot;Olives\&quot;,\&quot;price\&quot;:122.51}&quot;</span>,
    <span class="hljs-string">&quot;{\&quot;goodsId\&quot;:0,\&quot;goodsName\&quot;:\&quot;Honeydew melon\&quot;,\&quot;price\&quot;:122.05}&quot;</span>
]

&#x6240;&#x6709;&#x7684;&#x7528;&#x6237;&#x5F00;&#x59CB;&#x8FDB;&#x884C;&#x62A2;&#x8D2D;&#xFF1A;
 <span class="hljs-number">0</span> : &#x53F6;&#x6CFD;&#x6D0B; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">0</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Honeydew melon&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">122</span>.<span class="hljs-number">05</span>}
 <span class="hljs-number">1</span> : &#x767D;&#x660E; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">2</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Mulberries&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">71</span>.<span class="hljs-number">42</span>}
 <span class="hljs-number">2</span> : &#x6D2A;&#x5FD7;&#x6CFD; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">1</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Olives&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">122</span>.<span class="hljs-number">51</span>}
 <span class="hljs-number">3</span> : &#x6D2A;&#x9526;&#x7A0B; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">3</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Nectarines&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">19</span>.<span class="hljs-number">5</span>}
 <span class="hljs-number">4</span> : &#x9ECE;&#x4E50;&#x9A79; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">5</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Corella Pear&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">12</span>.<span class="hljs-number">8</span>}
 <span class="hljs-number">5</span> : &#x83AB;&#x9756;&#x742A; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">4</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Kiwi Fruit&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">125</span>.<span class="hljs-number">18</span>}
 <span class="hljs-number">6</span> : &#x6C6A;&#x5FD7;&#x6CFD; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">6</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Cavalo&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">20</span>.<span class="hljs-number">93</span>}
 <span class="hljs-number">7</span> : &#x5510;&#x8D8A;&#x5F6C; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">7</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Sultanas&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">59</span>.<span class="hljs-number">16</span>}
 <span class="hljs-number">9</span> : &#x9AD8;&#x9E4F;&#x98DE; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">8</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Cherries&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">76</span>.<span class="hljs-number">04</span>}
 <span class="hljs-number">8</span> : &#x9F9A;&#x6B63;&#x8C6A; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">9</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Mangosteens&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">105</span>.<span class="hljs-number">82</span>}
 <span class="hljs-number">11</span> : &#x960E;&#x6653;&#x5578; &#x62A2;&#x5230;&#x4E86; &#x79D2;&#x6740;&#x5546;&#x54C1;&#xFF1A;{<span class="hljs-string">&quot;goodsId&quot;</span>:<span class="hljs-number">10</span>,<span class="hljs-string">&quot;goodsName&quot;</span>:<span class="hljs-string">&quot;Prunes&quot;</span>,<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-number">88</span>.<span class="hljs-number">97</span>}
 <span class="hljs-number">10</span> : &#x5F20;&#x7B11;&#x611A; &#x6CA1;&#x6709;&#x62A2;&#x5230;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">13</span> : &#x6B66;&#x660E;&#x6770; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">12</span> : &#x5085;&#x6587; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">14</span> : &#x8881;&#x9526;&#x7A0B; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">16</span> : &#x5B59;&#x5B50;&#x9ED8; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">15</span> : &#x6234;&#x7ECD;&#x9F50; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">17</span> : &#x5F6D;&#x4E50;&#x9A79; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">18</span> : &#x5F6D;&#x8D8A;&#x5F6C; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">19</span> : &#x90B1;&#x4F1F;&#x5BB8; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">20</span> : &#x6D2A;&#x4FCA;&#x9A70; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">21</span> : &#x5415;&#x5FD7;&#x5F3A; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">22</span> : &#x9B4F;&#x4F1F;&#x5BB8; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">23</span> : &#x848B;&#x6D69;&#x7136; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">24</span> : &#x83AB;&#x4FEE;&#x6770; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">25</span> : &#x5F90;&#x7ACB;&#x679C; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">26</span> : &#x5085;&#x5FD7;&#x6CFD; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">27</span> : &#x6BB5;&#x65ED;&#x5C27; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">29</span> : &#x8C22;&#x601D;&#x6E90; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
 <span class="hljs-number">28</span> : &#x8983;&#x6977;&#x745E; &#x5546;&#x54C1;&#x5DF2;&#x7ECF;&#x5356;&#x5B8C;&#x4E86;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x4E86;&#x79D2;&#x6740;&#x5546;&#x54C1;
&#x79D2;&#x6740;&#x6D3B;&#x52A8;&#x7ED3;&#x675F;
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright @copy tianwyam 2021 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-10-26 20:57:44
</span></footer>
                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                <a href="redis_study_notes.html" class="navigation navigation-prev " aria-label="Previous page: redis学习笔记">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../SQL/sql_mysql_green_install.html" class="navigation navigation-next " aria-label="Next page: mysql绿色版安装服务教程">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Redis中的队列list实现秒杀活动抢购","level":"18.2","depth":1,"next":{"title":"mysql绿色版安装服务教程","level":"19.1","depth":1,"path":"SQL/sql_mysql_green_install.md","ref":"SQL/sql_mysql_green_install.md","articles":[]},"previous":{"title":"redis学习笔记","level":"18.1","depth":1,"path":"redis/redis_study_notes.md","ref":"redis/redis_study_notes.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","-sharing","github","tbfed-pagefooter","splitter","pageview-count","anchor-navigation-ex","chapter-fold","expandable-chapters-small","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright @copy tianwyam 2021","modify_label":"最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"github":{"url":"https://github.com/tianwyam"},"livereload":{},"splitter":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":false,"showLevel":false},"pageview-count":{},"expandable-chapters-small":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"tianwyam","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"JAVA学习积累","links":{"sidebar":{"博客Blog":"https://blog.csdn.net/mybook201314"}},"gitbook":"*","description":"积累Java学习过程中的知识点，俗话说：好记性不如烂笔头"},"file":{"path":"redis/redis_list_second_kill.md","mtime":"2021-10-26T12:57:44.858Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-11-03T12:24:01.188Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

